package com.ms.game.sendgift.db;

import java.util.Date;
import java.util.HashMap;

import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.xpec.c4.db.model.log.basic.BasicLogModel;

/**
 * 寄送禮物成功後記錄(寄送禮物頁面顯示用30天清除)
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(name = "send_gift_record" )
@org.hibernate.annotations.Table(
		appliesTo = "send_gift_record", indexes = {
				@org.hibernate.annotations.Index(name = "IDX_PLYAERID", columnNames = { "playerGUID"}),
				@org.hibernate.annotations.Index(name = "IDX_TARGETID",columnNames = {"targetGUID"}),
				@org.hibernate.annotations.Index(name ="IDX_GET_RECORD",columnNames = {"sendOrderID"}),
				@org.hibernate.annotations.Index(name ="IDX_FINISH_TIME",columnNames = {"orderFinishTime"})
		})
public class SendGiftRecordLog extends BasicLogModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2712992347473168166L;

	/**
	 * 寄送訂單ID
	 */
	private long sendOrderID;
	
	/**
	 * 訂單序號(顯示用)
	 */
	private String orderNumber;
	
	/**
	 * 交易ID(查log顯示用)
	 */
	private String orderID;
	
	/**
	 * 寄件者
	 */
	private String playerGUID;
	
	/**
	 * 寄件者名稱
	 */
	private String playerName;
	
	/**
	 * 寄件者IP
	 */
	private String playerIP;
	
	/**
	 * 收件者
	 */
	private String targetGUID;
	
	/**
	 * 收件者名稱
	 */
	private String targetName;
	
	/**
	 * 收件者IP
	 */
	private String targetIP;
	
	/**
	 * 金錢
	 */
	private long goldCoin;
	
	/**
	 * 手續費
	 */
	private long serviceCharge;
	
	/**
	 * 物品
	 */
	private HashMap<String,Integer> items;
	
	/**
	 * 交易階段
	 */
	private int stage;
	
	/**
	 * 創建時間
	 */
	private Date createTime;
	
	/**
	 * 回答時間
	 */
	private Date answerTime;
	
	/**
	 * 完成時間
	 */
	private Date completeTime;
	
	/**
	 * 取走的時間
	 */
	private Date finalTakenTime;
	
	/**
	 * 過時時間
	 */
	private Date overTime;
	
	/**
	 * 退回後領取時間
	 */
	private Date outTakenTime;
	
	/**
	 * 此訂單遭退回時間
	 */
	private Date sendbackTime;
	
	/**
	 * 是否已結束
	 */
	private boolean isFinish;
	
	/**
	 * 交易成功還是失敗
	 */
	private boolean isSuccess;
	
	/**
	 * 是否已拿取
	 */
	private boolean isTaken;
	
	/**
	 * 存放後是否錯誤
	 */
	private int errorCode;
	
	/**
	 * 訂單結束的時間
	 */
	private Date orderFinishTime;

	public long getSendOrderID() {
		return sendOrderID;
	}

	public String getPlayerGUID() {
		return playerGUID;
	}

	public String getPlayerName() {
		return playerName;
	}

	public String getTargetGUID() {
		return targetGUID;
	}

	public String getTargetName() {
		return targetName;
	}

	public long getGoldCoin() {
		return goldCoin;
	}

	@Type(type = "com.xpec.c4.db.usertype.MapStringIntegerToString")
	public HashMap<String, Integer> getItems() {
		return items;
	}

	public int getStage() {
		return stage;
	}

	public void setSendOrderID(long orderID) {
		this.sendOrderID = orderID;
	}

	public void setPlayerGUID(String playerGUID) {
		this.playerGUID = playerGUID;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}

	public void setTargetGUID(String targetGUID) {
		this.targetGUID = targetGUID;
	}

	public void setTargetName(String targetName) {
		this.targetName = targetName;
	}

	public void setGoldCoin(long goldCoin) {
		this.goldCoin = goldCoin;
	}

	public void setItems(HashMap<String, Integer> items) {
		this.items = items;
	}

	public void setStage(int stage) {
		this.stage = stage;
	}

	public Date getCompleteTime() {
		return completeTime;
	}

	public void setCompleteTime(Date completeTime) {
		this.completeTime = completeTime;
	}

	public Date getFinalTakenTime() {
		return finalTakenTime;
	}

	public void setFinalTakenTime(Date finalTakenTime) {
		this.finalTakenTime = finalTakenTime;
	}

	public String getPlayerIP() {
		return playerIP;
	}

	public String getTargetIP() {
		return targetIP;
	}

	public void setPlayerIP(String playerIP) {
		this.playerIP = playerIP;
	}

	public void setTargetIP(String targetIP) {
		this.targetIP = targetIP;
	}

	public String getOrderNumber() {
		return orderNumber;
	}

	public boolean isFinish() {
		return isFinish;
	}

	public boolean isSuccess() {
		return isSuccess;
	}

	public void setOrderNumber(String orderNumber) {
		this.orderNumber = orderNumber;
	}

	public void setFinish(boolean isFinish) {
		this.isFinish = isFinish;
	}

	public void setSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}

	public long getServiceCharge() {
		return serviceCharge;
	}

	public void setServiceCharge(long serviceCharge) {
		this.serviceCharge = serviceCharge;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public Date getAnswerTime() {
		return answerTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void setAnswerTime(Date answerTime) {
		this.answerTime = answerTime;
	}
	
	public Date getOverTime() {
		return overTime;
	}

	public void setOverTime(Date overTime) {
		this.overTime = overTime;
	}

	public int getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	public String getOrderID() {
		return orderID;
	}

	public void setOrderID(String orderID) {
		this.orderID = orderID;
	}

	public boolean isTaken() {
		return isTaken;
	}

	public void setTaken(boolean isTaken) {
		this.isTaken = isTaken;
	}

	public Date getOutTakenTime() {
		return outTakenTime;
	}

	public void setOutTakenTime(Date outTakenTime) {
		this.outTakenTime = outTakenTime;
	}

	public Date getSendbackTime() {
		return sendbackTime;
	}

	public void setSendbackTime(Date sendbackTime) {
		this.sendbackTime = sendbackTime;
	}

	public Date getOrderFinishTime() {
		return orderFinishTime;
	}

	public void setOrderFinishTime(Date orderFinishTime) {
		this.orderFinishTime = orderFinishTime;
	}
}
